package com.eagledata.project.business.clothesWashInstance.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.eagledata.common.utils.StringUtil;
import com.eagledata.project.business.clothesWashInstance.mapper.ClothesWashInstanceMapper;
import com.eagledata.project.business.clothesWashInstance.domain.ClothesWashInstance;
import com.eagledata.project.business.clothesWashInstance.service.IClothesWashInstanceService;

/**
 * 洗衣服务实例 服务层实现
 * 
 * @author eagledata
 * @date 2018-09-09
 */
@Service
public class ClothesWashInstanceServiceImpl implements IClothesWashInstanceService 
{
	@Autowired
	private ClothesWashInstanceMapper clothesWashInstanceMapper;
	
	/**
     * 查询洗衣服务实例信息
     * 
     * @param id 洗衣服务实例ID
     * @return 洗衣服务实例信息
     */
	 @Override
	public ClothesWashInstance selectClothesWashInstanceById(Long id) {
	    return clothesWashInstanceMapper.selectClothesWashInstanceById(id);
	}
	
	/**
     * 查询洗衣服务实例列表
     * 
     * @param clothesWashInstance 洗衣服务实例信息
     * @return 洗衣服务实例集合
     */
	 @Override
	public List<ClothesWashInstance> selectClothesWashInstanceList(ClothesWashInstance clothesWashInstance) {
	    return clothesWashInstanceMapper.selectClothesWashInstanceList(clothesWashInstance);
	}
	
    /**
     * 新增洗衣服务实例
     * 
     * @param clothesWashInstance 洗衣服务实例信息
     * @return 结果
     */
	 @Override
	public int insertClothesWashInstance(ClothesWashInstance clothesWashInstance) {
	    return clothesWashInstanceMapper.insertClothesWashInstance(clothesWashInstance);
	}
	
	/**
     * 修改洗衣服务实例
     * 
     * @param clothesWashInstance 洗衣服务实例信息
     * @return 结果
     */
	 @Override
	public int updateClothesWashInstance(ClothesWashInstance clothesWashInstance) {
	    return clothesWashInstanceMapper.updateClothesWashInstance(clothesWashInstance);
	}
	
	/**
     * 保存洗衣服务实例
     * 
     * @param clothesWashInstance 洗衣服务实例信息
     * @return 结果
     */
	 @Override
	public int saveClothesWashInstance(ClothesWashInstance clothesWashInstance) {
	    Long id = clothesWashInstance.getId();
		int rows = 0;
		if (StringUtil.isNotNull(id)) {
		    rows = clothesWashInstanceMapper.updateClothesWashInstance(clothesWashInstance);
		} else {
		    rows = clothesWashInstanceMapper.insertClothesWashInstance(clothesWashInstance);
		}
		return rows;
	}
	
	/**
     * 删除洗衣服务实例信息
     * 
     * @param id 洗衣服务实例ID
     * @return 结果
     */
	 @Override
	public int deleteClothesWashInstanceById(Long id) {
	    return clothesWashInstanceMapper.deleteClothesWashInstanceById(id);
	}
	
	/**
     * 批量删除洗衣服务实例对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	 @Override
	public int batchDeleteClothesWashInstance(Long[] ids) {
		return clothesWashInstanceMapper.batchDeleteClothesWashInstance(ids);
	}
	
}
